#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QStatusBar>
#include <QLabel>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    QStatusBar* statusbar = statusBar();
    setStatusBar(statusbar);

    //statusbar->showMessage("你好",2000);

    //添加控件
    QLabel* label = new QLabel("提示信息",this);
    statusbar->addWidget(label);

    //添加控件到右侧
    QLabel* label2 = new QLabel("右侧提示信息",this);
    statusbar->addPermanentWidget(label2);

}

MainWindow::~MainWindow()
{
    delete ui;
}

